# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sigar
pkgver=1.6.4
pkgrel=2
pkgdesc="System Information Gatherer And Reporter"
url="http://sigar.hyperic.com/"
arch="all !mips !mips64"
license="Apache-2.0"
makedepends="libtirpc-dev perl apache-ant openjdk8"
source="https://github.com/hyperic/sigar/archive/sigar-$pkgver.tar.gz
	0001-fix-compilation-with-musl-libc.patch
	0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
	0003-build-with-libtirpc-and-gcc5.patch
	0004-make-the-package-compile-on-MIPS.patch
	0005-no-m64-mips-arm.patch
	0006-fix-undefined-symbols.patch
	0007-sigar-add-sysmacros.patch
	"

builddir="$srcdir"/sigar-sigar-$pkgver

build() {
	cd "$builddir"/bindings/java
	ant
}

package() {
	cd "$builddir"/bindings/java
	mkdir -p "$pkgdir"/usr/lib
	install ./sigar-bin/lib/libsigar-*.so "$pkgdir"/usr/lib/
}

sha512sums="0515f3501a51357d6ac01dc5e3ecffae10995f347b98c66928adff247b86e52112d2bf9cf78b2633941eb9c7fb23f019f4885c41348fe461239e4eebd147253e  sigar-1.6.4.tar.gz
577f10add8dfe3f1e97375aba06fdecb4ae9d64d75246107cde2183a9efee5eeb8f2c00c072397e2ac4bba2dc49e67c5efef141c609f84a6128d03f3f5187d05  0001-fix-compilation-with-musl-libc.patch
12f68a3c3449b98a45458aa189a633d32ccc9adab83e04e84c8e496c1e0545a58ecc86fdcb68d55b162f5717244f69a48f0a13241b672c909993dc13643c8c64  0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
1896f8deb1945dd18283cb391528791b7554b2a4d56c0bc02a58d36a6af2a333782486a508e4d756b558d522d9a759bb3eefe12f0fd1720a9b83426d2b9bf469  0003-build-with-libtirpc-and-gcc5.patch
2999ac33ee0346ebb2d390bb4e315e340eb0c5c3e78c078f7687ddfa83b9817d13d46d4e1f7d208c75a49a279d035efb1a50af56c021d068ea313813e013c851  0004-make-the-package-compile-on-MIPS.patch
c77796ce9d34a42ea8663bf47b119ec1e3b8a4daf938dad7a15a4c11239cd58ee9797725da4c7defa846479db4d8eb190220beafc969c9dac5fa6d5adebf55b6  0005-no-m64-mips-arm.patch
b85593c1b07c2c7ac3cd66df70e2ab75e615547c14c797c4e6ce0508fc3a02988e5c9055f0dada14bdf0cb060c35129872239f01e9cf0e0481d0038578f93908  0006-fix-undefined-symbols.patch
678fe505286ec31297d1459788f44144ecd7f35a35523f53be8cf8d699e45491a4573968ac8e8f88620acdae49e5aa2b130dc18c1c7c311b026b3ed1e65166fe  0007-sigar-add-sysmacros.patch"
